// pages/card1/card1.js
var app = getApp();
var WxParse = require('../../wxParse/wxParse.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getData()
  },
  onShow(){
    app.checkUser(app.globalData.openid, this)
  },
  getData(){
    var that = this;
    wx.request({
      url: app.globalData.host + 'index.php/api/goods/goodsInfo?admin_id=' + app.globalData.admin_id + '&type=' + 67211 + '&code=3',
      success: function (e) {
        // console.log(e)
        that.setData({
          items: e.data.result[0]
        })
        // console.log(e.data.result[0])
        var article = e.data.result[0].goods_content;
        WxParse.wxParse('article', 'html', article, that, 8);
      }
    })
  },
  tobuy(){
    wx.navigateTo({
      url: '../../pages/buy/buy',
    })
  }

 
})